from Framebuffer import *
from Ray import *
from Sphere import *

s = Sphere([400,300,-10], 100)
ray = Ray()

def trace(x,y,r,g,b,px):
  global s
  
  ray.o.c[0] = x
  ray.o.c[1] = y
  
  if (s.Intersect(ray) == True):
    px[r],px[g],px[b] = [255,255,255]
  
f = Framebuffer()
slot = f.Create(1280, 720)

f.Register(slot, trace)
f.Process(slot)

f.Write(slot, "sphere")
